#include "gudb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    printf("=== Simple GuDB Test ===\n");
    
    // Create a temporary directory for testing
    system("mkdir -p /tmp/gudb_simple_test");
    
    // Test 1: Database creation and connection
    printf("1. Testing database creation...\n");
    gudb* db = gudb_open("/tmp/gudb_simple_test", GU_OPEN_CREATE, "admin", "admin");
    if (!db) {
        printf("❌ Failed to create database\n");
        return 1;
    }
    printf("✅ Database created successfully\n");
    
    // Test 2: Database cleanup
    printf("2. Testing database cleanup...\n");
    int close_ret = gudb_close(db);
    if (close_ret != GU_OK) {
        printf("❌ Failed to close database: %d\n", close_ret);
    } else {
        printf("✅ Database closed successfully\n");
    }
    
    printf("\n=== Simple Test Complete ===\n");
    
    // Cleanup test directory
    system("rm -rf /tmp/gudb_simple_test");
    
    return 0;
}